class Solution:
    def convert(self, s: str, numRows: int) -> str:
        a = ["" for i in range(numRows)]
        b = 0
        c = 1
        if numRows != 1:
            for i in range(len(s)):
                a[b] += s[i]
                if b == numRows-1:
                    c = -1
                elif b ==0 :
                    c = 1
                b+=c
        else:
            return s
        return "".join(a)
                